package com.test;

public class decide {
    int input(int a,double b){
        //判断用户答案和正确答案是否相同
        int tmp;
        if (a==b){
            System.out.println("回答正确,加一分");
            tmp = 1;
        }else {
            System.out.println("回答错误");
            tmp = 2;
        }
        return tmp;
    }
    void decide(double a,double b,int c) throws NoZeroException, LessZeroException {
        if (c == 1 && a-b<0){
            throw new LessZeroException("本题运算结果为负数");
        }else if(c == 3 && a/b<0){
            throw new LessZeroException("除法运算结果为负数");
        } else if (c == 3 && a == 0) {
            throw new NoZeroException("本题除法除数为0");
        }
    }
}
